import request from '@/utils/request'

export const loginAPI = (data) => {
  return request.post('/sys/login', data)
}
export const getUserInfoAPI = () => {
  return request.get('/sys/profile')
}
// export const updateUserPwdAPI = (data) => {
//   return request.put('/sys/user/updatePass', data)
// }
export const updateUserPwdAPI = (data) => {
  return request({
    url: '/sys/user/updatePass',
    method: 'put',
    data
  })
}
export const getManagerListAPI = () => {
  return request.get('/sys/user/simple')
}

/**
 * 新增组织
 * ***/
export const addDepartmentAPI = (data) => {
  return request.post('/company/department',
    data
  )
}
export const getDepartMentExitAPI = (id) => {
  return request.get(`/company/department/${id}`)
}
export const exitDepartMentAPI = (data) => {
  return request.put(`/company/department/${data.id}`, data)
}
export const delDepartMentAPI = (id) => {
  return request.delete(`/company/department/${id}`)
}
export const getUserDetailById = (id) => {
  return request.get(`/sys/role/${id}`)
}
